Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Adjust reading package to return null if Logo not specified #12753

Merged
merged 3 commits into from
Jul 4, 2023

Conversation

nickrandolph
Copy link
Contributor

@nickrandolph nickrandolph commented Jun 29, 2023

GitHub Issue (If applicable): closes #12752

PR Type

What kind of change does this PR introduce?

  • Bugfix

What is the current behavior?

If manifest file is missing, or logo isn't specified in manifest, the Package.Current.Logo property will return an invalid Uri
Also, because manifest wasn't read, each access for Logo and DisplayName will cause another attempt to read manifest file

What is the new behavior?

TryParsePackageManifest returns value indicating whether manifest was successfully read
TryParsePackageManifest will only execute the reading of manifest once
Package.Current.Logo is nullable Uri and will only return Uri if a logo path was provided

Copilot Summary

🤖 Generated by Copilot at 751c0c8

Refactored the Package class to improve manifest parsing and made the Logo property nullable for unsupported platforms.

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

Internal Issue (If applicable):

@nickrandolph nickrandolph marked this pull request as ready for review June 29, 2023 13:08
@nventive-devops
Copy link
Contributor

The build 84428 found UI Test snapshots differences: android-28-net7: 0, android-28-net7-Snap: 55, ios: 38, ios-Snap: 91, skia-gtk-screenshots: 20, skia-wpf-screenshots: 14, wasm: 45, wasm-automated-net7.0-UWP-Benchmarks: 0, wasm-automated-net7.0-UWP-Default: 42, wasm-automated-net7.0-UWP-RuntimeTests: 0, wasm-automated-net7.0-WinUI-RuntimeTests: 0

Details
  • android-28-net7: 0 changed over 1

  • android-28-net7-Snap: 55 changed over 1038

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • NavigationView_NavigationView_BasicNavigation_SamplesApp_Samples_Windows_UI_Xaml_Controls_NavigationViewTests_NavigationView_BasicNavigation
    • ListView_ListViewLargeLegacy_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewLargeLegacy
    • PagerControl_UITests_Microsoft_UI_Xaml_Controls_PagerControlTests_PagerControlPage_UITests_Microsoft_UI_Xaml_Controls_PagerControlTests_PagerControlPage
    • Slider_Slider_Inside_ScrollViewer_Uno_UI_Samples_Content_UITests_Slider_Slider_Inside_ScrollViewer
    • TextBlock_UITests_Shared_Windows_UI_Xaml_Controls_TextBlockControl_TextBlock_Layout_UITests_Shared_Windows_UI_Xaml_Controls_TextBlockControl_TextBlock_Layout
    • Automation_UITests_Shared_Windows_UI_Xaml_Automation_AutomationProperties_Name_UITests_Shared_Windows_UI_Xaml_Automation_AutomationProperties_Name
    • BreadcrumbBar_MUXControlsTestApp_BreadcrumbBarPage_MUXControlsTestApp_BreadcrumbBarPage
    • PullToRefresh_UITests_Microsoft_UI_Xaml_Controls_RefreshContainerTests_RefreshContainerScrollTop_UITests_Microsoft_UI_Xaml_Controls_RefreshContainerTests_RefreshContainerScrollTop
    • Image_UITests_Windows_UI_Xaml_Controls_ImageTests_Image_Formats_UITests_Windows_UI_Xaml_Controls_ImageTests_Image_Formats
    • ListView_HorizontalListView_Templates_SamplesApp_Windows_UI_Xaml_Controls_ListView_HorizontalListView_Templates
    • NavigationView_MUXControlsTestApp_NavigationViewCustomThemeResourcesPage_MUXControlsTestApp_NavigationViewCustomThemeResourcesPage
    • Progress_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • Transform_TransformToVisual_Simple_SamplesApp_Wasm_Windows_UI_Xaml_Media_Transform_TransformToVisual_Simple
    • TabView_UITests_Microsoft_UI_Xaml_Controls_TabViewTests_TabViewPage_UITests_Microsoft_UI_Xaml_Controls_TabViewTests_TabViewPage
    • Default_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ListView_ListView_IsSelected_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ListView_ListView_IsSelected
    • Icons_UITests_Microsoft_UI_Xaml_Controls_ImageIconTests_ImageIconPage_UITests_Microsoft_UI_Xaml_Controls_ImageIconTests_ImageIconPage
    • MediaPlayerElement_MediaPlayerElement_Stretch_Fill_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Stretch_Fill
    • MediaPlayerElement_Mini_player_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Minimal
    • MediaPlayerElement_Sources_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Sources
    • Scrolling_UITests_Windows_UI_Xaml_Controls_ScrollViewerTests_ScrollViewer_Nested_UITests_Windows_UI_Xaml_Controls_ScrollViewerTests_ScrollViewer_Nested
  • ios: 38 changed over 270

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ComboBoxTests_ToggleDisabled_ComboBox_Enabled
    • Keyboard_Textbox_NoScrollViewer_Validation_0_-_Remove_Focus_on_normalTextBox
    • ListView_ObservableCollection_Creation_Count_Scrolled1
    • ScrollViewer_WhenSync_RunNormalAndCompletesWithNonIntermediate_UITests_Shared_Windows_UI_Xaml_Controls_ScrollViewerTests_ScrollViewer_UpdatesMode
    • Screenshots_Image_Stretch_Alignment_Bigger_Mode-1
    • Screenshots_Image_Stretch_Alignment_Equal_Mode-0
    • When_Visibility_Changed_During_Arrange_UITests_Shared_Windows_UI_Xaml_Controls_TextBlockControl_TextBlock_Visibility_Arrange
    • ComboBoxTests_ToggleDisabled_ComboBox_Disabled
    • ProgressRing_Visibility_Collapsed_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • Screenshots_Image_Stretch_Alignment_SizeOnControl_Mode-2
    • TextBox_UpdatedBinding_On_OneWay_Mode_UITests_Windows_UI_Xaml_Controls_TextBox_TextBox_Bindings
    • BasicExpressionTest_UITests_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBox_ExpressionTest
    • Screenshots_Image_Stretch_Alignment_SizeOnControl_Mode-1
    • Screenshots_Image_Stretch_Alignment_Wider_Mode-1
    • Screenshots_Image_Stretch_Alignment_Wider_Mode-2
    • Keyboard_Textbox_NoScrollViewer_Validation_5_-_Remove_Focus_on_numberTextBox
    • ListView_ObservableCollection_Creation_Count_Removed_above
    • Screenshots_Image_Stretch_Alignment_Bigger_Mode-2
    • Screenshots_Image_Stretch_Alignment_Wider_Mode-0
    • Screenshots_Image_Stretch_Alignment_Wider_Mode-3
  • ios-Snap: 91 changed over 1029

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Buttons_Custom_Button_With_ContentTemplate_Uno_UI_Samples_Content_UITests_ButtonTestsControl_Custom_Button_With_ContentTemplate
    • ContentControl_ContentControl_DefaultText_Uno_UI_Samples_Content_UITests_ContentControlTestsControl_ContentControl_DefaultText
    • Icons_UITests_Windows_UI_Xaml_Controls_IconSourceTests_IconSourceElementTests_UITests_Windows_UI_Xaml_Controls_IconSourceTests_IconSourceElementTests
    • TextBox_TextBox_Disabled_State_Uno_UI_Samples_Content_UITests_TextBoxControl_TextBox_Disabled_State
    • WebView_UITests_Microsoft_UI_Xaml_Controls_WebView2Tests_WebView2_Title_UITests_Microsoft_UI_Xaml_Controls_WebView2Tests_WebView2_Title
    • Buttons_Hyperlink_Disabled_nVentive_Umbrella_Views_UI_Samples_Content_UITests_ButtonTestsControl_Hyperlink_Disabled
    • Flyouts_MenuFlyout_DroidAltTab_UITests_Windows_UI_Xaml_Controls_MenuFlyoutTests_MenuFlyout_DroidAltTab
    • Windows_ApplicationModel_Calls_PhoneCallHistoryManager_UITests_Shared_Windows_ApplicationModel_Calls_PhoneCallHistoryEntryReaderTests
    • Brushes_ImageBrushWithLateSource_Uno_UI_Samples_UITests_ImageBrushTestControl_ImageBrushWithLateSource
    • Buttons_Button_Opacity_Automated_Uno_UI_Samples_Content_UITests_ButtonTestsControl_Button_Opacity_Automated
    • ContentControl_ContentControl_FindName_Uno_UI_Samples_Content_UITests_ContentControlTestsControl_ContentControl_FindName
    • ContentControl_ContentControl_Inheritance_Uno_UI_Samples_Content_UITests_ContentControlTestsControl_ContentControl_Inheritance
    • ListView_ListView_Padding_Unconstrained_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListView_Padding_Unconstrained
    • TextBox_Input_InputScope_Email_Uno_UI_Samples_Content_UITests_TextBoxControl_Input_InputScope_Email
    • TextBox_Input_InputScope_PhoneNumber_Uno_UI_Samples_Content_UITests_TextBoxControl_Input_InputScope_PhoneNumber
    • WebView_WebView_NavigateToString2_UITests_Shared_Windows_UI_Xaml_Controls_WebView_WebView_NavigateToString2
    • WebView_WebView_NavigateToUri_Uno_UI_Samples_Content_UITests_WebView_WebView_NavigateToUri
    • Brushes_UITests_Shared_Windows_UI_Xaml_Media_ImageBrushTests_ImageBrush_SameWithDelay_UITests_Shared_Windows_UI_Xaml_Media_ImageBrushTests_ImageBrush_SameWithDelay
    • Buttons_Uno_UI_Samples_Content_UITests_ButtonTestsControl_Custom_Button_With_ContentTemplate_And_StackPanel_Uno_UI_Samples_Content_UITests_ButtonTestsControl_Custom_Button_With_ContentTemplate_And_StackPanel
    • FrameworkElement_UnloadedMeasure_UITests_Shared_Windows_UI_Xaml_FrameworkElementTests_FrameworkElement_UnloadedMeasure
  • skia-gtk-screenshots: 20 changed over 1108

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • MUX-WinUIProgressRing_CustomSources.png
    • MediaPlayerElement-MediaPlayerElement_Stretch_Fill.png
    • MUX-WinUIProgressRingPage.png
    • PipsPager-PipsPagerExamples.png
    • Image-LargeImageList.png
    • MediaPlayerElement-Using .3gp.png
    • MediaPlayerElement-Using .avi.png
    • MUX-TabViewPage.png
    • Pickers-CalendarView_Theming.png
    • GridView-GridViewSelection.png
    • Progress-WinUIProgressRingPage.png
    • Progress-WinUIProgressRing_CustomSources.png
    • Progress-WinUIProgressRing_Features.png
    • Progress-ProgressRingHeightTest.png
    • Progress-WindowsProgressRing_GH1220.png
    • ListView-ListViewSelectedItems.png
    • NavigationView-NavigationViewRS4Page.png
    • Image-UniformToFill100x100.png
    • TabView-TabViewPage.png
    • WinUI-PipsPagerExamples.png
  • skia-wpf-screenshots: 14 changed over 1108

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Progress-ProgressRingHeightTest.png
    • Progress-WindowsProgressRing_GH1220.png
    • MUX-WinUIProgressRing_CustomSources.png
    • Image-LargeImageList.png
    • MUX-TabViewPage.png
    • Pickers-CalendarView_Theming.png
    • ListView-ListViewSelectedItems.png
    • TabView-TabViewPage.png
    • PipsPager-PipsPagerExamples.png
    • Progress-WinUIProgressRingPage.png
    • Progress-WinUIProgressRing_CustomSources.png
    • Progress-WinUIProgressRing_Features.png
    • MUX-WinUIProgressRingPage.png
    • WinUI-PipsPagerExamples.png
  • wasm: 45 changed over 1035

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • MUXControlsTestApp.NavigationViewStretchPage
    • UITests.Shared.Windows_UI_Xaml_Controls.ListView.ListView_With_ListViews_Count_Measure
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ListView.ListView_IsSelected
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewChangeView
    • UITests.Windows_UI_Xaml_Controls.CalendarView.CalendarView_Theming
    • UITests.Shared.Microsoft_UI_Xaml_Controls.ColorPickerTests.WinUIColorPickerPage
    • UITests.Shared.Windows_UI_Xaml_Controls.ListView.ListView_Explicit_Items
    • UITests.Windows_Media.MediaPlayerTests
    • UITests.Windows_UI_ViewManagement.ApplicationViewSizing
    • UITests.Windows_UI_Xaml_Controls.ProgressRing.WindowsProgressRing_GH1220
    • SamplesApp.Samples.Windows_UI_Xaml_Controls.NavigationViewTests.NavigationView_BasicNavigation
    • UITests.Windows_UI_Xaml.UIElementTests.UIElement_MeasureDirtyPath
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewLargeHeader
    • UITests.Windows_UI_Xaml_Shapes.PathStretchModes
    • MUXControlsTestApp.PersonPicturePage
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Stretch_Fill
    • MUXControlsTestApp.PipsPagerExamples
    • Uno.UI.Samples.Content.UITests.CommandBar.CommandBar_With_Long_Sentences
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewVariableHeightComplexTemplate
    • UITests.Microsoft_UI_Xaml_Controls.ProgressRing.WinUIProgressRingPage
  • wasm-automated-net7.0-UWP-Benchmarks: 0 changed over 1

  • wasm-automated-net7.0-UWP-Default: 42 changed over 1917

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • MinMaxTest_UITests_Shared_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBoxPage
    • ColorPicker_WinUIColorPickerPage_UITests_Shared_Microsoft_UI_Xaml_Controls_ColorPickerTests_WinUIColorPickerPage
    • Fonts_UITests_Windows_UI_Xaml_Media_FontTests_DynamicFont_UITests_Windows_UI_Xaml_Media_FontTests_DynamicFont
    • LoopingSelector_UITests_Windows_UI_Xaml_Controls_LoopingSelectorTests_LoopingSelector_Short_UITests_Windows_UI_Xaml_Controls_LoopingSelectorTests_LoopingSelector_Short
    • Default_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ListView_ListView_IsSelected_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ListView_ListView_IsSelected
    • Image_Image_Stretch_None_Uno_UI_Samples_UITests_ImageTestsControl_Image_Stretch_None
    • MediaPlayerElement_MediaPlayerElement_Stretch_Fill_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Stretch_Fill
    • MediaPlayerElement_Mini_player_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Minimal
    • ListView_SelectedItems_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewSelectedItems
    • ListView_ListViewSelectedItems_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewSelectedItems
    • MediaPlayerElement_Sources_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Sources
    • MediaPlayerElement_Using_3gp_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_3gp_Extension
    • MediaPlayerElement_Using_avi_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Avi_Extension
    • MediaPlayerElement_Using_flv_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Flv_Extension
    • MediaPlayerElement_Using_mkv_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Mkv_Extension
    • MediaPlayerElement_Using_mov_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Mov_Extension
    • MediaPlayerElement_Using_mp3_Audio_only_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Mp3_Extension
    • MediaPlayerElement_Using_ogg_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Ogg_Extension
    • Image_LargeImageList_Uno_UI_Samples_UITests_LargeImageList
    • Brushes_Uno_UI_Samples_Samples_Shared_Content_UITests_ImageBrushInList_Uno_UI_Samples_Samples_Shared_Content_UITests_ImageBrushInList
  • wasm-automated-net7.0-UWP-RuntimeTests: 0 changed over 1

  • wasm-automated-net7.0-WinUI-RuntimeTests: 0 changed over 1

Copy link
Member

@Youssef1313 Youssef1313 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with minor stylistic comments that you are not important.

@nickrandolph nickrandolph merged commit dd37d25 into master Jul 4, 2023
@nickrandolph nickrandolph deleted the dev/nr/logonotnull branch July 4, 2023 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Gtk] Invalid Logo path returned when package manifest is missing
3 participants